﻿@{
    ViewBag.Title = "意见反馈";
    Layout = "~/Views/Shared/_layoutPersonal.cshtml";
}
@Styles.Render("~/Content/css/feedback")
<article class="main">
    <div class="lay">
        <nav class="mod_nav">
            <div class="lay_left">
                <a class="nav_back" onclick="turnBack()"><img src="/images/TurnBackNormal.png"></a>
                <span>意见反馈</span>
            </div>
            <div class="lay_right">
                <a class="btn_send" onclick="sendFeedback()" value="0">发送</a>
            </div>
        </nav>
        <div class="alert alert-warning" style="display:none" role="alert">
            <strong></strong>
        </div>
        <div class="lay_top">
            <textarea class="textarea" placeholder="请输入反馈，我们将不断为您改进"></textarea>
            <input class="input_text" placeholder="您的邮箱或手机号码（选填）" type="text">
        </div>
    </div>
</article>
<script>
    function sendFeedback() {
        $(".alert").attr("style", "display:none");
        $(".alert strong").html("请输入反馈内容，谢谢！");
        var content = $(".textarea").val();
        var contact = $(".input_text").val();
        if (content.length == 0) {
            $(".textarea").focus();
            $(".alert").attr("style", "display:block");
            $(".alert strong").html("请输入反馈内容，谢谢！");
        } else {
            OtherMgr.sendFeedback(content, contact);
            alert("您的意见我们已经收到，十分感谢！");
            $(".textarea").val("");
            $(".input_text").val("");
        }
    }

    function turnBack() {
        window.location.href = '@Url.Content("~/")' + 'User/Index';
    }
</script>
